﻿
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>AJAX调用ashx示例</title>
    <script type="text/javascript">
        var xmlHttp;

        var timestamp = Date.parse(new Date())/1000;

        function createXMLHttpRequest()
        {
            if(window.ActiveXObject)
            {
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            else if(window.XMLHttpRequest)
            {
                xmlHttp = new XMLHttpRequest();
            }
        }

        function ExcuteFun() {

            window.location.href = "../Handle/ExchangeHandlerService.ashx?method=Get_ExchangeEvalInfo_List&pagesize=10000&pageindex=1&ExchangeID=6&ISALL=all";
            //console.info();
        }


//        function ExcuteFun() {
//            alert("到了这一步！");
//            createXMLHttpRequest();
//            var url = "../Handle/AdminHandlerService.ashx?timestamp=" + timestamp + "&method=Get_Admin_Confirm_Yes_List" +
//            "&Title=" +document.getElementById("Title").value +
//            "&Content=" + document.getElementById("Content").value+
//            "&UID="+document.getElementById("UID").value+
//            "&ExchangeID="+document.getElementById("ExchangeID").value+

//            "&PageIndex=" + document.getElementById("PageIndex").value+
//            "&PageSize=" + document.getElementById("PageSize").value+
//            "&IsAll=" + document.getElementById("IsAll").value
//            
//            ;

//            xmlHttp.open("POST",url,true);
//            xmlHttp.onreadystatechange=showResult;
//            xmlHttp.send(null);
//            alert(url);
//        }
//        function showResult()
        {
            if(xmlHttp.readyState==4)
            {
                if(xmlHttp.status==200)
                {
                    document.getElementById("Button1").value = xmlHttp.responseText;
                    alert(xmlHttp.responseText);

                 }
            }
        }
    </script>
    <style type="text/css">
        #Button1
        {
            width: 716px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div style="text-align: center">
        <input id="num1" style="width: 99px" type="text" value="0" onkeyup="" />+<input id="num2" style="width: 95px"
            type="text" value="0" onkeyup="addNumber();" />=<input id="result" style="width: 99px" type="text" /><br />
        <h1>
            <span class="title text_overflow">
            <a href="http://bbs.csdn.net/topics/340015415" target="_blank">Handler.ashx文件里面的方法是怎么调用的？</a>点左侧链接查看</span></h1>
    </div>
            <br />
            <hr />
            <input id="Title" style="width: 366px" type="text" 
        value="等待输入标题包含的单词！" /><br />
            <input id="Content" style="width: 371px" type="text" 
        value="等待输入较多的测试内容！" /><br />
            <input id="ExchangeID" style="width: 142px" type="text" 
        value="记录编号ExchangeID" /><br />
            <input id="UID" style="width: 358px" type="text" 
        value="fe2499d5-c9d5-4680-83b6-c25022118129" /><br />

                    <input id="IsAll" style="width: 358px" type="text" 
        value="PART" /><br />


            <input id="PageIndex" style="width: 99px" type="text" value="页码" /><br />
            <input id="PageSize" style="width: 99px" type="text" value="记录数" /><br />

            <input id="Button1" type="button" value="执行" onclick="ExcuteFun();" />
    </form>
</body>
</html>
